package org.flown.novel.data;

import com.baomidou.mybatisplus.annotation.*;

import lombok.Data;

@Data
@TableName("author")
public class Author
{
    public enum Column
    {
        ID("id"),
        USER_ID("user_id"),
        NAME("name"),
        BOOKS_ID("books_id"),
        REGISTER_TIME("register_time");

        private final String name;
        Column(String name){this.name = name;}
        public String getName(){return this.name;}
    }

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id = 0;
    private Integer userId = 0;
    private String name;
    private String booksId = "[]";//用时转json,[id1, id2, id3]
    @TableField(fill = FieldFill.INSERT, insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
    private java.util.Date registerTime;//会自动填充

    public Author(){}
    public Author(int user_id, String name)
    {
        this.userId = user_id;
        this.name = name;
    }

}

